package com.yeyks.commonReference.service.vip;

import com.yeyks.common.em.pay.PayTypeEnum;
import com.yeyks.commonReference.pojo.param.vip.MemberCardOnline.MemberCardOnlineSetPasswordParam;
import com.yeyks.consumer.dal.domain.MemberCard;
import com.yeyks.vip.param.MemberCardEnableRecordCreateOrderPayRecordParam;
import com.yeyks.vip.param.MemberCardOnlinePlaceAnOrderServiceParam;
import com.yeyks.vip.vo.MemberCardEnableOrderPlaceAnOrderVo;
import com.yeyks.vip.vo.MemberCardOnlineCheckEnableCardVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

public interface MemberCardOnlineService {
    //检查是否有卡可以出售v3.8.3
    MemberCardOnlineCheckEnableCardVo checkEnableCard(Integer cardType);

    //获取一张可以出售的卡v3.8.3
    MemberCard getEnableCard(Integer cardType);

    //下单v3.8.3
    @Transactional(rollbackFor = Exception.class)
    MemberCardEnableOrderPlaceAnOrderVo placeAnOrder(MemberCardOnlinePlaceAnOrderServiceParam param);

    //根据订单生成支付信息和支付记录v3.8.3
    Map<String, Object> createOrderPayRecord(MemberCardEnableRecordCreateOrderPayRecordParam param);

    //卡初始密码设置失败
    void setPassword(MemberCardOnlineSetPasswordParam param);

    //会员卡enable订单支付回调v3.8.3
    void payCallback(String orderNo, PayTypeEnum payTypeEnum, Object resultCode, Boolean succeeded);
}
